{% extends "_layouts/default.html" %}
{% block content %}

<script type="text/javascript">
    $().ready(function(){

        $("#editForm").validate({
            rules:{
                name: {required:true},
                url: {required:true,url:true}
            }
        });
    });
</script>
<div class="tabs_title clearfix">
  <h3>友情链接管理</h3>

<ul>
<li class="current"><a href="/admin/link"><span>友情链接列表</span></a></li>
<li><a href="/admin/link/edit"><span>添加</span></a></li>
</ul>


</div>
<div class="block tips">
    <h3>添加/修改友情链接</h3>
    <form id="editForm"  class="adminform" action="" method="post" enctype="multipart/form-data">
        <input type="hidden" name="lid" value="{{link.lid}}" />

        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="maintable">
            <tr>
                <td align="right" width="20%">链接名称:</td>
                <td><label>
                        <input type="text" name="name" id="name" class="txt" value="{{link.name}}" />
                </label></td>
            </tr>            <tr>
                <td align="right"  width="20%">链接地址:</td>
                <td><label>
                        <input type="text" name="url" id="url" class="txt small" value="{{link.url}}" />
                </label></td>
            </tr>

            <tr>
                <td align="right">网站介绍:</td>
                <td><textarea name="intro" id="intro" cols="45" rows="5" class="txt">{{link.intro}}</textarea></td>
            </tr>
      <tr>
                <td align="right"  width="20%">排序数:</td>
                <td><label>
                        <input type="text" name="sort" id="sort" class="txt small" value="{{link.sort}}" />
                </label></td>
            </tr>
            <tr>
                <td align="right" >审核状态:</td>
                <td>
                    <label>
                        <input {% if link.ischeck %} checked="checked"{% endif %} type="radio" class="checkbox" name="ischeck" value="1" id="ischeck_0" />
                    已通过</label>
                    <label>
                        <input {% if not link.ischeck %} checked="checked"{% endif %} type="radio" class="checkbox" name="ischeck" value="0" id="ischeck_1" />
                待审核</label>              </td>
            </tr>
            <tr >
                <td>&nbsp;</td>
                <td><input type="submit" name="userssubmit" value=" 提交 " class="btn" />&nbsp;&nbsp;<input type="button" value=" 返回 " onclick="history.go(-1);" class="btn" /></td>
            </tr>
        </table>

    </form>
</div>  
{% endblock %}